package com.easyweb.session;

import com.easyweb.entity.*;
import java.math.BigDecimal;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("bayiGpsHome")
public class BayiGpsHome extends EntityHome<BayiGps> {

	@In(create = true)
	BayiHome bayiHome;

	public void setBayiGpsId(BigDecimal id) {
		setId(id);
	}

	public BigDecimal getBayiGpsId() {
		return (BigDecimal) getId();
	}

	@Override
	protected BayiGps createInstance() {
		BayiGps bayiGps = new BayiGps();
		return bayiGps;
	}

	public void load() {
		if (isIdDefined()) {
			wire();
		}
	}

	public void wire() {
		getInstance();
		Bayi bayi = bayiHome.getDefinedInstance();
		if (bayi != null) {
			getInstance().setBayi(bayi);
		}
	}

	public boolean isWired() {
		return true;
	}

	public BayiGps getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

}
